// com/iot/gateway/tsl/model/TslServiceEntity.java
package com.iot.gateway.tsl.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 设备命令固定字段实体
 * 对应表 tsl_service，已扩展 required、call_type、input_data、output_data、method
 */
@Data
@TableName(value = "tsl_service", autoResultMap = true)
public class TslServiceEntity {

    @TableId(type = IdType.ASSIGN_UUID)
    private String serviceId;

    private String deviceId;

    private String name;

    /**
     * JSON 中的 "desc"
     */
    private String description;

    private Boolean required;

    private String callType;

    /**
     * 存储 inputData 数组
     */
    @TableField(value = "input_data", typeHandler = JacksonTypeHandler.class)
    private List<Map<String, Object>> inputData;

    /**
     * 存储 outputData 数组
     */
    @TableField(value = "output_data", typeHandler = JacksonTypeHandler.class)
    private List<Map<String, Object>> outputData;

    private String method;

    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;
}
